#pragma once
#include <set>
#include "IRunnable.h"

namespace bs
{
	class IUpdateable
	{
	public:
		virtual void Update(size_t time, size_t frames, size_t elapse) = 0;
	};

	class UpdateProcess : public IRunnable
	{
	public:
		UpdateProcess();
		~UpdateProcess();

		virtual void Run(int id, size_t time, size_t frames, size_t elapse, void* userData);

		void AddUpdater(IUpdateable* updater) { this->updaters.insert(updater); }
		void RemoveUpdater(IUpdateable* updater) { this->updaters.erase(updater); }

	private:
		std::set<IUpdateable*> updaters;
	};

}
